
<?php
//数据库总数据条数
//http://localhost/1908php/countgoodsinfo.php?key=1
@require_once("toubu.php");
$key = $_GET["key"];
$sql = "select  count(*) from  gucciinfo  where goodsname  like  '%$key%'";

$result = mysql_query($sql);//count(*)只有一条

$item = mysql_fetch_array($result);

$obj= array();

$obj["count"]=$item[0];

echo  json_encode($obj);

?>
